<?php
namespace app\api\controller;
use think\Controller;
class Index extends Controller{

    public $_url="http://192.168.0.103";

    public function getslider(){

        header('Content-Type:application/json');    
       
        $data=db("article")->field("id,title,thumb as imgurl")->where("cateid=1")->select();
        
        foreach($data as $k => $v){
            $data[$k]["imgurl"]=$this->_url.str_replace("\\","/",$v["imgurl"]);  
        }     

        echo json_encode($data);
    }
   

}
